﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPFChat.Model;
using be.metanous.mvvm.core;

namespace WPFChat.ViewModel
{
    public class ApplicationViewModel : ViewModelBase
    {
        public ApplicationViewModel()
        {
            CurrentUser = new PersonViewModel();
            Personen = new ObservableCollection<PersonViewModel>();
            ChatViewModel = new ChatViewModel();
            States = new ObservableCollection<StateViewModel>();
        }

        private PersonViewModel _currentUser;

        public PersonViewModel CurrentUser
        {
            get { return _currentUser; }
            set
            {
                if (_currentUser != value)
                {
                    _currentUser = value;
                    RaisePropertyChanged(() => CurrentUser);
                }
            }
        }

        private ObservableCollection<StateViewModel> _states;

        public ObservableCollection<StateViewModel> States
        {
            get { return _states; }
            set
            {
                if (_states != value)
                {
                    _states = value;
                    RaisePropertyChanged(() => States);
                }
            }
        }

        private ObservableCollection<PersonViewModel> _personen;

        public ObservableCollection<PersonViewModel> Personen
        {
            get { return _personen; }
            set
            {
                if (_personen != value)
                {
                    _personen = value;
                    RaisePropertyChanged(() => Personen);
                }
            }
        }

        private ChatViewModel _chatViewModel;

        public ChatViewModel ChatViewModel
        {
            get { return _chatViewModel; }
            set
            {
                if (_chatViewModel != value)
                {
                    _chatViewModel = value;
                    RaisePropertyChanged(() => ChatViewModel);
                }
            }
        }
    }
}
